package cn.fintecher.pangolin.service.business.web;

import cn.fintecher.pangolin.common.web.BaseController;
import cn.fintecher.pangolin.service.business.model.response.AppHomeResponse;
import cn.fintecher.pangolin.service.business.service.AppHomeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Auther: xiaqun
 * @Description: APP统计相关接口
 * @Date: 16:57 2019/11/13
 */

@RestController
@RequestMapping("/api/appHomeController")
@Api(value = "APP统计相关接口", description = "APP统计相关接口")
public class AppHomeController extends BaseController {
    @Autowired
    private AppHomeService appHomeService;

    /**
     * 首页相关统计
     */
    @ApiOperation(value = "首页相关统计", notes = "首页相关统计")
    @GetMapping("/getHomePage")
    public ResponseEntity<AppHomeResponse> getHomePage(@RequestHeader(value = "X-UserToken") String token) {
        log.info("REST request to get home page");
        AppHomeResponse response = appHomeService.getHomePage(token);
        return ResponseEntity.ok().body(response);
    }
}
